package com.hhf.feiojapiservice.client;

import com.hhf.feiojapiservice.config.DefaultFeignConfig;
import com.hhf.feiojapiservice.fallback.QuestionClientFallbackFactory;
import com.hhf.feiojcommonservice.model.entity.Question;
import com.hhf.feiojcommonservice.model.entity.QuestionSubmit;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author hhf
 * @Date 2024/11/3
 * @Description
 */
@FeignClient(name = "feioj-question-service",path = "/api/question/inner",fallbackFactory = QuestionClientFallbackFactory.class,configuration = DefaultFeignConfig.class)
public interface QuestionFeignClient {


    //questionService.getById(questionId)
    //questionSubmitService.updateById(updateQuestionSubmit)
    //questionSubmitService.getById(questionSubmitId)

    @GetMapping("/id")
    Question getQuestionById(@RequestParam("questionId") long questionId);

    @PutMapping("/id")
    boolean updateById(@RequestBody QuestionSubmit questionSubmit);


    @GetMapping("/submit/id")
    QuestionSubmit getQuestionSubmitById(@RequestParam("questionSubmitId") long questionSubmitId);
}
